/*
 * IChater.h
 *
 *  Created on: 2012-7-16
 *      Author: guanlei
 */

#ifndef ICHATER_H_
#define ICHATER_H_

#include "chat_server_define.h"
#include "string.h"
class MsgBase;
class UserChatMsg;
class IChannel;
typedef UserChatMsg Message;
class IChater{
public:
	IChater(CHATER_ID chater_id){
		_chater_id = chater_id;
	}
	virtual	~IChater(){}
	virtual void    SendMessageToChater(CHATER_ID,Message*) = 0;
	virtual void    SendMessageToChannel(CHANNEL_ID,Message*) = 0;
	virtual void 	RecvMessageFromServer(Message*) = 0;
	virtual void	SendCmdToClient(MsgBase*) = 0;
	virtual	void	LeaveAllChannel()	=	0;
	virtual void	LeaveChannel(IChannel*) = 0 ;
	virtual void 	EnterChannel(IChannel*) = 0;
	CHATER_ID		GetChaterId(){
		return		_chater_id;
	}

	const char*		GetChaterName()const{
		return _chater_name;
	}

	void			SetChaterName(const char* cname){
		strncpy(_chater_name,cname,20);
		_chater_name[19] = '\0';
	}

private:
	CHATER_ID		_chater_id;
	char			_chater_name[20];
};

#endif /* ICHATER_H_ */
